package cn.lupin.controller;

import cn.lupin.pojo.Bgm;
import cn.lupin.service.BgmService;
import cn.lupin.utils.LaughJSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;

@RestController
@Api(value="背景音乐业务的接口", tags= {"背景音乐业务的controller"})
@RequestMapping("/bgm")
public class BgmController {
	
	@Autowired
	private BgmService bgmService;
	
	@ApiOperation(value="获取背景音乐列表", notes="获取背景音乐列表的接口")
	@PostMapping("/list")
	public LaughJSONResult list() {
		List<Bgm> bgmList = bgmService.queryBgmList();
		return LaughJSONResult.ok(bgmList);
	}
}
